<div class="carrinho">
    
    <?php if(count($this->row) > 0) { ?>
    <table class="tbProdutos">
        <thead>
        <tr>
            <td></td>
            <td>Curso</td>
            <td>Investimento</td>
            <td></td>
        </tr>
        </thead>
        <tbody>
        <?php 
        $total = 0;    
        foreach ($this->row as $row) { 
            
            $hoje = strtotime(date('Y-m-d'));
            $datapro = strtotime($row->CUR_PROMDAT);
            $valor = $row->CUR_VLR;
            if($datapro >= $hoje){
                $valor = $row->CUR_PROM;
            }
            
            $total += $valor;
        ?>
            <tr>
                <td>
                    <?php
                    $img = 'public/upload/curso/' . $row->CUR_ID . '_p.*';
                    foreach (glob($img) as $src)
                        $img = $src;
                    ?>
                    <img src="<?php echo $this->urlbase . '/' . $img; ?>" width="270px" height="120px" />
                </td>
                <td width="450px">
                    <?php echo $row->CUR_NOM; ?>
                    <p><?php echo $row->CUR_APR; ?></p>
                </td>
                <td>R$ <?php echo tools::float_to_money($valor); ?></td>
                <td><a href="javascript:void(0)" title="Remover Curso" class="btn-retCurso tp" id="<?php echo $row->CUR_ID?>"></a></td>
            </tr>
        <?php } ?>
        </tbody>
    </table>
    <div class="valores">
        TOTAL <span id="valores">R$ <?php echo tools::float_to_money($total); ?></span>
    </div>
    <a href="<?php echo $this->urlbase.'/cursos'; ?>" class="btn-vlt">Quero mais cursos</a>
    <?php if(count($this->row) > 0) { ?><a href="<?php echo $this->url(array('controller' => 'pagamento', 'action' => 'pagamento')); ?>" class="btn-compra">CONTINUAR</a><?php } ?>
    <?php } else { ?>
        <div class="car_vazio">Seu carrinho de cursos está vazio!</div>
        <a href="<?php echo $this->urlbase.'/cursos'; ?>" id="btn-escolha" class="btn-escolha"><span class="seta">&laquo;</span> Escolha um Curso!</a>
    <?php } ?>
    
</div>